import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import request from '@/utils/request'

Vue.config.productionTip = false

Vue.use(ElementUI, {size: "small"});

Vue.prototype.request = request

new Vue({
  created() {
    window.addEventListener('unhandledrejection', this.handlePromiseError);
  },
  beforeDestroy() {
    window.removeEventListener('unhandledrejection', this.handlePromiseError);
  },
  methods: {
    handlePromiseError(event) {
      console.error('Unhandled Promise Rejection:', event.reason);
    },
  },
  router,
  render: h => h(App)
}).$mount('#app')
